<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ include file="/taglibs.jsp"%>

<script src="/js/grid.locale-en.js" type="text/javascript"></script>
<script src="/js/jquery.jqGrid.min.js" type="text/javascript" charset="UTF-8"></script>
<link rel="stylesheet" type="text/css" media="screen" href="/css/ui.jqgrid.css" />
<link href="/css/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" media="screen" />


${pu:reqSet('user', pu:user())}
<%--判斷訂單修改 --%>
<c-rt:set var="canChgPaymentIfo" value="N"/>
<c-rt:set var="canChgRecvInfo" value="N"/>

<c:choose>
	<c:when test="${order.paymentTp=='30' || order.paymentTp=='60'}">
		<c:if test="${order.orderSt=='00'}">
			<c-rt:set var="canChgPaymentIfo" value="Y"/>
			<c-rt:set var="canChgRecvInfo" value="Y"/>
		</c:if>
		<c:if test="${order.orderSt=='20' }">
			<c-rt:set var="canChgRecvInfo" value="Y"/>
		</c:if>
	</c:when>
	<c:otherwise>
		<c:if test="${order.domainSrc!='www.yaodian100.com' && (order.orderSt=='00'||order.orderSt=='05')}">
		   	 <c-rt:set var="canChgRecvInfo" value="Y"/>
		</c:if>
		<c:if test="${order.paymentSt=='00' && order.orderSt == '10'}">
			<c:choose>
			<c:when test="${order.paymentTp=='80'}"><%--分期付款不能修改支付方式 --%>
				<c-rt:set var="canChgPaymentIfo" value="N"/>
			</c:when>
			<c:otherwise>
				<c-rt:set var="canChgPaymentIfo" value="Y"/>
			</c:otherwise>
			</c:choose>								
			<c-rt:set var="canChgRecvInfo" value="Y"/>
		</c:if>
		<c:if test="${order.paymentSt=='10' && order.sync=='false' && order.orderSt == '20'}">
			<c-rt:set var="canChgRecvInfo" value="Y"/>
		</c:if>			          
	</c:otherwise> 
</c:choose>
<script type="text/javascript" charset="UTF-8" src="../js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../js/jquery.alphanumeric.js"></script>

<style>
.type-0,.type-1,.type-2,.type-3,.type-4,.type-5,.type-money{font-size:12px; padding:1px 3px;*padding:3px 3px 0;}
.type-0{display:none;} /* 主商品 */
.type-1{background:#FCF; color:#333;}/* 預購 */
.type-2{background:#94ebf2; color:#333;}/* 贈品 */
.type-3{background:#ffcc99; color:#333;}/* 加購 */
.type-4{background:#d5f091; color:#333;}/* 活動 */
.type-5{ background:#FF0; color:#333; }/* 满额购 */
.type-6{background:#d5f091; color:#333;}/* 活動 */
</style>
<script language="javascript">
var content;
	$().ready( function() {	
		$("#editShipFare").hide();
		$("#newShipfare").numeric({allow:"."});	
		if($('#dialog').length==0){
			$('body').append('<div id="dialog"></div>');
		}
		if($('#dialog2').length==0){
			$('body').append('<div id="dialog2"></div>');
		}

	
		 
	    
	//更新狀態
		$(":input[id*=updOrdSt]").click(function(){
			var orderId = $(this).attr('id').split('_')[1];
			var orderStCode = $(this).attr('id').split('_')[2];
			if(orderStCode=='20'){
				if(!confirm('确定等待配货？'))return;
			}else if(orderStCode=='05'){
				if(!confirm('确定转成人工處理？'))return;
			}else{
				if(orderStCode=='10'){
					if(!confirm('确定等待付款？'))return;
				}else{
					if(!confirm('确定取消？'))return;
				}
				
			}

			
			location.href="/ecadmin/order/updOrdSt.do?orderId="+orderId+"&orderStCode="+orderStCode;
			
			//function callback(result){				
			//	if(result=='success'){
			//		alert("更新成功");
			//		//window.location.replace("<%=application.getContextPath()%>/order/query.do");
			//		window.location.reload();
			//	}else{
			//		alert("更新失敗");
			//	}
			//}
					
		});	
		$(":input[id*=sendSms]").click(function(){
			var orderId = $(this).attr('id').split('_')[1];
			var orderContact = $(this).attr('id').split('_')[2];
			
			var smsMsg = "尊敬的会员，您好！您的订单编号："+orderId+"，为了确保配送品质因多次联络不到您，您的订单将不成立，若有需要再麻烦请您重新订购";
			if(orderContact==''){
				alert('不正确的手机号码');
				return;
			}

			if(!confirm('确定发送短信？\n'+smsMsg))return;
			doAR('<%=application.getContextPath()%>/sms/sendSms.do?orderId='+orderId+'&orderContact='+orderContact+'&smsMsg='+smsMsg, 'dialog');openDialog('订单 '+orderId+' 短信发送记录',null,800,400);
					
		});	
		$("#newShipfareCancel").click(function(){
			$("#editShipFare").hide();
		});
		
		/** 1250.中台提供订单取消/还原功能  **/
		$("#btnCancelOrder").click(function() {
			doAR('/ecadmin/order/cancel/toCancelOrder.do?orderId=${order.orderId}' ,'cancelDialog');
			openCancelDialog('取消订单',null,500,410);
			return false;
		});
		$("#btnRevertOrder").click(function() {
			if (!confirm("确认还原订单?")) return false; 			
			doAR('/ecadmin/order/cancel/revertOrder.do?orderId=${order.orderId}' ,'cancelDialog');
			openCancelDialog('还原订单',null,400,210);
			return false;
		});
		/** 1250.中台提供订单取消/还原功能  end **/
		
	});
	
	/** 1250.中台提供订单取消/还原功能  **/
	function openCancelDialog(title, content,width,height){
		$('#cancelDialog').dialog('destroy');
		if ( width =="" || width == 0) width = 500;
		if ( height =="" || height == 0) height = 400;
		$('#cancelDialog').dialog(
			{ 
				bgiframe:true,
				title:title,
				width:width,
				height:height,
				modal: true
			}
		);
	}
	function closeCancelDialog() {
		$('#cancelDialog').dialog('close');
	}
	/** 1250.中台提供订单取消/还原功能  end **/
	
  function openBankPayment() {
	  window.open("../bankPayment/queryByOrder.do?orderId=${order.orderId}", "bankPayment", "height=300, width=400,left=50, top=50, menubar=no, toolbar=no, location=yes, directories=no, status=yes,scrollbars=yes,resizable=yes");
  }
  function openThirdPayment() {
	  window.open("../thirdPartyPayment/queryByOrder.do?orderId=${order.orderId}", "bankPayment", "height=300, width=600,left=50, top=50, menubar=no, toolbar=no, location=yes, directories=no, status=yes,scrollbars=yes,resizable=yes");
	}
  function editShipfare(){
	  $("#editShipFare").show();
  }
  function submitShipfare(){
	  if(confirm("确认修改运费?\n原运费:<fmt:formatNumber value="${order.shipfare}" pattern="#,###,##0.00"/>，新运费:"+$("#newShipfare").val())){
		$("#updateShipfareForm").submit();
	  }else{
		  $("#editShipFare").hide();
		  $("#newShipfare").val(<fmt:formatNumber value="${order.shipfare}" pattern="#,###,##0.00"/>);
	     return false;
	  }

  }
  function askOrderForLock(){
	  $.post("<%=application.getContextPath()%>/crmUpdateOrder/askOrderForUpdate.do",{orderId:${order.orderId}},callback);
		function callback(result){
			$("#askOrderForLock").hide();				
			if(result.indexOf('true')>=0){
				$("#updateOrderAndShipfare").show();
			}else{
				alert("本订单无法修改！后台："+result);
			}
		}		
  }
function setMemoContent(id) {
	if($('#dialog2').length == 0) {
		$('body').append('<div id="dialog2"></div>');
	}
	if($('#memoIframe').length == 0) {
		$('#dialog2').append('<iframe id="memoIframe"></iframe>');
	}
	$('#memoIframe').attr('width', '760')
		.attr('height', '360')
		.css({
			'border': '0px'
		});
	$('#memoIframe').attr('src', '<%=application.getContextPath()%>/order/viewOrderMemo.do?orderId=' + id);
  }
</script>

<h1>订单管理</h1>
<c-rt:if test="${order.domainSrc=='yaodian100.tmall.com'}">
<table width="320"><tr><td>
<table class="tb-data">
<tr>
<th>淘宝订单功能</th>
<td>
<c-rt:if test="${order.orderSt=='00'}">
<input name="按鈕" type="button" value="人工處理" id="updOrdSt_${order.orderId}_05"/>
<input name="按鈕" type="button" value="等待配货" id="updOrdSt_${order.orderId}_20"/>
</c-rt:if>
<c-rt:if test="${order.orderSt=='05'}">
<input name="按鈕" type="button" value="修改订单" onclick="location.href='<c-rt:url value="/tmall/toUpdateOrder.do?orderId=${order.orderId }"/>'"/>
<input name="按鈕" type="button" value="修改收货地址" onclick="location.href='<c-rt:url value="/order/editReceiver.do?orderId=${order.orderId}"/>'"/>
</c-rt:if>
</td>

</tr>
</table>
</td></tr></table>
</c-rt:if>

<font color="#ff3300">
<s:actionerror />
<s:actionmessage />
${errMsg }
<s:fielderror />
</font>
<div class="f-link">
<c-rt:if test="${order.orderSt=='80' or order.orderSt=='81'}">
	<yaodian100:checkPermission permissions="OTHER_CANCELORDER">
		<a href="#" id="btnRevertOrder">还原订单</a> / 
	</yaodian100:checkPermission>
</c-rt:if>
<c-rt:if test="${order.orderSt=='10' or order.orderSt=='20'}">
	<yaodian100:checkPermission permissions="OTHER_CANCELORDER">
		<a href="#" id="btnCancelOrder">取消订单</a> / 
	</yaodian100:checkPermission>
</c-rt:if>
<c-rt:if test="${order.orderSt=='35' || order.orderSt=='90'}">
<a href="<c-rt:url value="/cs/page.do?questionType=ReturnShipfare&iamlazy=question&formType=workOrder&memberId=${order.memberId}&orderId=${order.orderId}"/>">运费返还工单</a>
</c-rt:if>
<c-rt:if test="${order.orderSt!='00' && order.orderSt!='10' && order.orderSt!='20'}">
<a href="/ecadmin/cs/page.do?iamlazy=question&questionType=AskDeliver&formType=workOrder&orderId=${order.orderId }">询问配送商</a> /
</c-rt:if>
<c-rt:if test="${pu:user().groupName=='A-30-400-000'}">
<c-rt:if test="${order.orderSt=='25'}">
<a href="#" onclick="askOrderForLock()" id="askOrderForLock">查询是否可修改订单</a>
<span  id="updateOrderAndShipfare" style="display:none">
<a href="#" onclick="location.href='/ecadmin/crmUpdateOrder/toUpdateOrderAndShipfare.do?orderId=${order.orderId}';">修改訂單及運費</a> / 
</span>
</c-rt:if>
</c-rt:if>
<c-rt:if test="${order.orderSt=='35'}">
<c-rt:forEach items="${order.orderProduct}" var="op">
<c-rt:if test="${!empty op.prodStatus && op.prodStatus!='0'}">
${pu:reqSet('isServiced', '1') }
</c-rt:if>
</c-rt:forEach>
<c-rt:if test="${isServiced!='1'}">
<a href="#" onclick="if(confirm('是否确认整张订单要退货?')){location.href='/ecadmin/serviceOrder/toReturnAllProduct.do?orderId=${order.orderId}';}">整单退货</a> / 
</c-rt:if>
</c-rt:if>
<yaodian100:checkPermission permissions="GROUP_A-30-400-000,GROUP_C.01,GROUP_C.01">
<c-rt:if test="${canChgRecvInfo=='Y'}"><a href="<c-rt:url value="/order/editReceiver.do?orderId=${order.orderId}"/>" >修改收货人讯息</a> / </c-rt:if>
<c-rt:if test="${canChgPaymentIfo=='Y'}"><a href="<c-rt:url value="/order/editPaymentTp.do?orderId=${order.orderId}"/>" >修改支付方式</a> / <a href="#editShipFareHere" onClick="editShipfare();">修改运费</a> / </c-rt:if>
</yaodian100:checkPermission>
<c-rt:if test="${order.sync==true}">
<a href="<%=ServerValue.getBackHostname()%><%=ServerValue.getBackContextPath()%>/crm/so/view.do?vw_orderId=${order.orderId}" target="_blank">查看出货明细</a> / 
</c-rt:if>
<c-rt:if test="${order.orderSt!='00' && order.orderSt!='10' && order.orderSt!='20'}">
<a href="<%=ServerValue.getBackHostname()%><%=ServerValue.getBackContextPath()%>/crm/outStockOrders/ecCrmView.do?ecCrmOrderId=${order.orderId}" target="_blank">缺货查询</a> / 
</c-rt:if>
<c-rt:if test="${order.paymentTp == '50'}"><a href="javascript:openThirdPayment();">查看付款记录</a> / </c-rt:if>
<c-rt:if test="${order.paymentTp == '10' || order.paymentTp == '20' }"><a href="javascript:openBankPayment();">查看汇款记录</a> / </c-rt:if>
<c-rt:if test="${not empty pop}"><a href="javascript:window.close()">关闭视窗</a> / </c-rt:if>
<a href="javascript:doAR('<%=application.getContextPath()%>/sms/viewSms.do?orderId=${order.orderId}', 'dialog');openDialog('订单  ${order.orderId} 短信发送记录',null,800,400);">查看短信记录</a> /
<a href="javascript:doAR('<%=application.getContextPath()%>/order/viewOrderStatusHistory.do?orderId=${order.orderId}', 'dialog');openDialog('订单  ${order.orderId} 订单状态历程',null,800,400);">订单状态历程</a> /
<a href="<c-rt:url value="/cs/page.do?questionType=CommonQuestion&iamlazy=question&formType=workOrder&isProductQAA=false&memberId=${order.memberId}&orderId=${order.orderId}&channel=${pu:substring(user.group.code, 0, 1)=='C' ? 'CS':'SYS'}"/>" target="_wo">开立工单</a> / 
<a href="<c-rt:url value="/workOrder/page.do?iamlazy=list&orderId=${order.orderId}&fromOrder=true"/>" target="_wol">问答纪录</a> 
<c-rt:if test="${pu:substring(user.group.code, 0, 1)=='C'}"><c:if test="${empty order.syncDt }"><!-- / <a href="editReceiver.do?orderId=${order.orderId}">修改收件资料</a> / <a href="editInvoice.do?orderId=${order.orderId}">修改发票资料</a>--></c:if></c-rt:if>/
<a href="javascript:setMemoContent('${order.orderId}');openDialogById('订单  ${order.orderId} 订单信息',null,800,400,'dialog2');">订单信息</a> / 
<c-rt:if test="${pu:substring(user.group.code, 0, 1)!='C'}"><a href="search.do">回订单查询页</a></c-rt:if>
<c-rt:if test="${pu:substring(user.group.code, 0, 1)=='C'}"><a href="../crmQuery/search.do">回CRM 查询</a></c-rt:if>
</div>
<br><table width="100%" border="1" cellspacing="0" cellpadding="0" class="tb-data">
  <tr>
    <td height="30" align=left><b>订单编号：
    </b> ${order.orderId}
    <c-rt:if test="${not empty order.tuangouId}">
    <span class="icon-tuangou"><a href="javascript:doAR('<%=application.getContextPath()%>/tuangou/getTuangouInfo.do?tuangouId=${order.tuangouId}', 'dialog');openDialog('团购说明',null,400,300);" title="${order.tuangouName}">${order.tuangouId}</a></span>
    </c-rt:if>
    <br/>
<c-rt:if test="${order.orderId ne order.joinOrders}">合并结帐：
<c-rt:set var="joinOrders" value="${fn:split(order.joinOrders, ',')}" />
<c-rt:forEach items="${joinOrders}" var="joinOrder" varStatus="status">
<c-rt:if test="${status.index ne 0}">,</c-rt:if>
<a href="/ecadmin/order/view.do?orderId=${joinOrder}">${joinOrder}</a>
</c-rt:forEach>
<br/></c-rt:if>
<c-rt:if test="${order.orderSt eq '83'}">拆分訂單：
<c-rt:set var="newOrders" value="${fn:split(order.newOrderId, ',')}" />
<c-rt:forEach items="${newOrders}" var="newOrder" varStatus="status">
<c-rt:if test="${status.index ne 0}">,</c-rt:if>
<a href="/ecadmin/order/view.do?orderId=${newOrder}">${newOrder}</a>
</c-rt:forEach>
<br/></c-rt:if>
    <c-rt:if test="${order.orderSt=='80' || order.orgOrderId!=null}">
    	<c-rt:if test="${order.orderSt=='80'}">
    		${pu:reqSet('hqlMFK', 'from Orders where orgOrderId=?') }
    		${pu:listAdd('orderFKParams', order.orderId) }
    		${pu:reqSet('theOrdersFK', pu:queryByHql(hqlMFK, pu:arrayGet('orderFKParams'), null)) }
    		<c-rt:if test="${theOrdersFK !=null}">
    		(新成立订单：<a href="/ecadmin/order/view.do?orderId=${theOrdersFK[0].orderId }" target="_blank">${theOrdersFK[0].orderId }</a>)<br/>
    		</c-rt:if>
    	</c-rt:if>
    	<c-rt:if test="${order.orgOrderId!=null}">
    		(原订单：<a href="/ecadmin/order/view.do?orderId=${order.orgOrderId }" target="_blank">${order.orgOrderId }</a>)<br/>
    	</c-rt:if>
    
    </c-rt:if>
    <b>会员编号：</b>${order.memberId } </td>
    <td align=left><b>订购人：</b><a href='../member/view.do?memberId=${order.memberId}'>${order.memberName}</a></td>
    <td align=left><b>订单状态：
    	<c:if test="${empty cancelServiceOrders}">${orderStMenu.options[order.orderSt].name}</c:if>
    	<c:if test="${!empty cancelServiceOrders}">
    	<a href="<c-rt:url value="/serviceOrder/page.do?iamlazy=detail&&serviceId=${cancelServiceOrders[0].serviceId}&from=orderView"/>">${orderStMenu.options[order.orderSt].name}</a>
    	</c:if></b>
    				<c-rt:if test="${order.orderSt=='00'}"><br/>
    					<c-rt:if test="${order.domainSrc!='www.yaodian100.com'}">
    						<input name="按鈕" type="button" value="人工處理" id="updOrdSt_${order.orderId}_05"/>
    				   		<input name="按鈕" type="button" value="等待配貨" id="updOrdSt_${order.orderId}_20"/>
    					</c-rt:if>
    					<c-rt:if test="${order.domainSrc=='www.yaodian100.com'}">    					
							<input name="按鈕" type="button" value="审核失败" id="updOrdSt_${order.orderId}_82"/>
							<c-rt:if test="${order.paymentTp=='30' || order.paymentTp=='60'}">	
								<input name="按鈕" type="button" value="等待配貨" id="updOrdSt_${order.orderId}_20"/>
							</c-rt:if>
							<c-rt:if test="${order.paymentTp=='10' || order.paymentTp=='20'||order.paymentTp=='40' || order.paymentTp=='50'}">	
								<input name="按鈕" type="button" value="等待付款" id="updOrdSt_${order.orderId}_10"/>
							</c-rt:if>	
						</c-rt:if>
					</c-rt:if>
					<c-rt:if test="${order.paymentTp=='30'&&order.orderSt=='00'}">
						<c-rt:if test="${order.domainSrc!='yaodian100.tmall.com'}"> 
							<br><input name="按鈕" type="button" value="联络不到简讯通知" id="sendSms_${order.orderId}_${fn:trim(order.receiverMobile)}"/>
						</c-rt:if>
					</c-rt:if>
					
					<c-rt:if test="${order.orderSt=='80' || order.orderSt=='81'}">
						<br/>取消时间：<fmt-rt:formatDate value="${order.modifyDate}" pattern="yyyy-MM-dd HH:mm"/>
					</c-rt:if>
    </td>
    <td align=left><b>订购日期：</b><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${order.orderDt}" /></td>
  </tr>
  <tr>
    <td height="30" align=left><b>付款方式：</b>${paymentTpMenu.options[order.paymentTp].name} <c-rt:if test="${order.paymentTp=='80'}">(${order.orderCreditCardCampaign.creditcartPeriod}期) </c-rt:if>(<a href="<c:url value="/order/viewChangeLog.do?orderId=${order.orderId}&logTp=chgPaymentTp"/>" >查看历程</a>)</td>
    <td align=left><b>付款状态：</b>${paymentStMenu.options[order.paymentSt].name}</td>
    <td align=left><b>订单来源：</b>${order.channel}<br><b>网站：</b>${domainSrc.options[order.domainSrc].name}</td>
    <td align=left><b>付款期限：</b><font color="#ff3300">
   	<c-rt:if test="${order.paymentTp!='30'}">
    <fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${order.deadline}" />
    </c-rt:if>
    </font></td>
  </tr>
  <tr>
    <td height="30" align=left><b>收件人：${order.receiverName} (<a href="<c:url value="/order/viewChangeLog.do?orderId=${order.orderId}&logTp=chgRecvInfo"/>" >查看历程</a>)</td>
    <td colspan="${order.receiverTp=='30'?2:3 }" align=left>行動：${order.receiverMobile}<br />
    固定：${order.receiverPhoneArea}-${order.receiverPhone}-${order.receiverExt}<br />
    地址：(${order.receiverZip})[${order.receiverProvince}${order.receiverCity}${order.receiverArea}]&nbsp;${order.receiverAddr}
    <c:if test="${order.receiverTp=='30'}"><a href="<c:url value="/dpn/queryStore.do?dpnStoreId=${order.storeId} "/>" target="_blank">店点资讯</a>   
	<img src="/images/daphne/daphne.gif"></c:if>
    </td>
    <c:if test="${order.receiverTp=='30'}">
    <td>    
	运送方式:達芙妮到店取貨<br />
	到店日期: <c-rt:if test="${!empty order.logisticFinalDt}"><fmt-rt:formatDate value="${order.logisticFinalDt }" pattern="yyyy-MM-dd HH:mm:ss"/></c-rt:if>
          <c-rt:if test="${empty order.logisticFinalDt }">--</c-rt:if> <br />
	签收日期: <c-rt:if test="${!empty order.logisticSignDt}"><fmt-rt:formatDate value="${order.logisticSignDt }" pattern="yyyy-MM-dd HH:mm:ss"/></c-rt:if>
          <c-rt:if test="${empty order.logisticSignDt }">--</c-rt:if> <br />
	</td>
    
	</c:if>
	
  </tr>
  <tr>
    <td height="30" align=left><b>订单类型：${order.orderType==1?'一般':''}${order.orderType==2?'SCM':''}${order.orderType==3?'外部订单':''} <font color="#ff3300">(${order.allowSplit=='Y'?"有货先发":"货齐再发"})</font>
    <c:if test="${order.orderType=='3'}"><br>外部订单编号：${order.outerOrderId}</c:if></td>   
     <td align=left colspan="2">发票抬头：${order.invoiceTp=='01'?"个人":order.invoiceTitle}</td>
      <td align=left>供应商是否自行配送：${order.isSelfShip=='Y'?"是":"否"}</td>
  </tr>
  <tr>
  <td align=left colspan="2">转单供应商名称：${supplierApply.companyName}<BR />
    <c:if test="${order.isSelfShip=='Y'}">
     退（换）货联络窗口：${supplierApply.returnContact}<BR />
     退（换）货联络电话：${supplierApply.returnPhone}<BR />
     退（换）货详细地址：(${supplierApply.returnZip}) [ ${supplierApply.returnProvince}${supplierApply.returnCity}${supplierApply.returnArea} ] ${supplierApply.returnAddr}
    </c:if>
    </td>  
    <td height="30" colspan="2" valign="top" align=left><b>内部备注</b><BR>
　　<textarea name=memo cols="70" rows="5">${order.memo}</textarea></td>
  </tr>
<c:if test="${order.campaign}">
  <tr height="30">
    <td colspan="5" align=left>活动：</td>
  </tr>
</c:if>
</table>
<b><BR />
订单重量
</b><BR />
<table width="100%" class="tb-data" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><b>订单重量：</b><fmt-rt:formatNumber value="${(order.totalWeight+0.001)/1000 }"  pattern="#,#0.00#"/>KG</td>
  </tr>
</table>
<b><br />
<iframe src="<%=ServerValue.getBackHostname()%>/erp/crm/so/crmViewStatus.do?vw_orderId=${order.orderId}" width="100%" height="220px" frameborder="0"></iframe> 
<b>付款资讯</b><br />
<table width="100%" class="tb-data" border="1" cellpadding="0" cellspacing="0">
  <tr class="bg-yl">
    <td height="30" align="left" colspan="2">付款日期：<b><font color="#ff3300"><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${order.paymentDt}" /></font></b></td>
    <td height="30" align="left" >已付金额：<b><font color="#ff3300"><fmt:formatNumber value="${order.cash}" pattern="#####0.00"/></font></b></td>
    <td height="30" align="left">已退coupon：<b><font color="#ff3300"><fmt:formatNumber value="${order.returnCoupon}" pattern="#####0.00"/></font></b></td>
  </tr>
  <tr class="bg-yl">
	  <td height="30" align="left">已退金额：<b><font color="#ff3300"><fmt:formatNumber value="${order.returnCash}" pattern="#####0.00"/></font></b></td>
    <td height="30" align="left">已退积分：<c-rt:if test = "${not empty order.orderBonusCampaign}">${order.returnBonus*order.orderBonusCampaign.offsetRate}</c-rt:if><c-rt:if test = "${empty order.orderBonusCampaign}">0</c-rt:if></td>
    <td align="left">已退我的帐户：<fmt:formatNumber value="${order.returnMyWallet}" pattern="#####0.00"/><c-rt:if test="${order.returnedCodFee!=0}">(包含已退货到付款手续费：<fmt:formatNumber value="${order.returnedCodFee}" pattern="#####0.00"/>)</c-rt:if></td>
    <td align="left">退款日期：<c-rt:if test="${order.returnCash!=0 || order.returnBonus!=0 || order.returnMyWallet!=0 || order.returnGiftcardBalance!= 0 && !empty order.refundDate}"><fmt:formatDate value="${order.refundDate }" pattern="yyyy-MM-dd"/></c-rt:if></td>
  </tr>
  <tr class="bg-yl">
    <td height="30" align="left">已退礼品卡：<fmt:formatNumber value="${order.returnGiftcardBalance}" pattern="#,###,##0.00"/></td>
    <td height="30" align="left" colspan="2">已退金额中包含，已退运费：<fmt:formatNumber value="${order.returnShipfare}" pattern="#,###,##0.00"/></td>
    <td><c-rt:if test="${order.paymentTp=='80'}">已退分期手续费：<fmt:formatNumber value="${order.returnInstallmentFee}" pattern="#,###,##0.00"/></c-rt:if></td>
  </tr>
</table>
<br /> 
<B>订购内容</B>
<span class="txt-rd">(预：预购，备货：前台商品备货提示)</span>
<br/>
<table width="100%" border="1" cellpadding="0" cellspacing="0" class="tb-1">
	<thead>
	<tr>
	 <th>商品编号</th>
   <th height="30">商品</th>
    <th>重量</th>
		<th>体积</th>
    <th>数量</th>
    <th>单价</th>
    <th>coupon</th>
    <th>小计</th>
    <th>合计</th>
    <th>出货日</th>
    <th>到货日</th>
    <!-- <th>退货数</th>-->
    <th>物流状态</th> 
    <th>物流公司与单号</th>
    <th>其他</th>
		<th>备注</th>
	</tr>
	</thead>
<c:forEach items="${order.orderProduct}" var="oproduct" varStatus="row_index">
<c:if test="${oproduct.prodTp!='2'}">
  <tr class="${row_index.count % 2 == 0 ? 'bg-yl' : ''}"><!-- 主商品 -->
  	<td> ${oproduct.prodId}<a href="<%=ServerValue.getFrontHostname()%><%=ServerValue.getFrontContextPath()%>/product/product.do?productId=${oproduct.prodId}" target="blank">开启</a><br>
  	<c-rt:if test="${fn:contains(snapShots,oproduct.prodId)}">
  	<a href="<c-rt:url value="/resource/${order.orderId}_${oproduct.prodId}_${oproduct.prodTp}.jpg?memberId=${order.memberId}"/>" target="blank">商品快照</a>
  	</c-rt:if>
  	</td>
    <td height="30" style="text-align:left;">
<span class="type-${oproduct.prodTp}">${detailTpMenu.options[oproduct.prodTp].name}</span> ${oproduct.prodName}<c:if test="${oproduct.prodTp!=6}">－<b>[${oproduct.prodSpecName}]</b></c:if>
<c-rt:if test="${(order.orderSt=='35' || order.orderSt=='90') && oproduct.prodStatus!='1' && oproduct.prodStatus!='2'}">
[ <a href="/ecadmin/serviceOrder/toReturnProduct.do?orderProdId=${oproduct.orderProdId }">退货</a> ｜ <a href="/ecadmin/serviceOrder/toChangeProduct.do?orderProdId=${oproduct.orderProdId }">换货</a> ]
</c-rt:if>
<br/>


<br/>

<%try{ %>

<c-rt:forEach items="${oproduct.applyCampaigns}" var="ac">
	          	
	          	<p>
	          	<c-rt:if test="${ac.active}">
	          		<span class="type-4" style="color:red">优惠</span>
	          	</c-rt:if>
	          	<c-rt:if test="${!ac.active}">
	          		<span class="type-6"  style="color:gray">优惠</span>（不符合）
	          	</c-rt:if>
	          <c-rt:if test="${ac.campaignUrl!=null}">
	          	<a target="_blank" class="a-red" href="${ac.campaignUrl }">${ac.campaignName }</a>
	          	</c-rt:if>
	          	<c-rt:if test="${ac.campaignUrl==null}">
	          	
	          	${pu:reqSet('pc', pu:get('com.yaodian100.ec.campaign.entity.Campaign', ac.campaignUuid)) }
	          	
	          	${ac.campaignName }
	          	
	          	</c-rt:if>
	          	</p>
	          	</c-rt:forEach>

<%}catch(Exception e){
    e.printStackTrace();
    
    }%>
    <c:forEach items="${oproduct.orderProductDetail}" var="opdetail" varStatus="rowdetail_index">
    	<c-rt:if test="${oproduct.prodSeq == opdetail.prodSeq and oproduct.prodSpecId eq opdetail.prodSpecId}">
				<c-rt:if test="${opdetail.canUseCod eq 'N'}">
		    	<p>付款限定：<span class="txt-rd">不支持货到付款</span></p>
		  	</c-rt:if>
		  	<c-rt:if test="${not empty prodVolumeMap and not empty prodVolumeMap[opdetail.prodId]}">
					<p>配送限定：<span class="txt-rd">大材积</span></p>
				</c-rt:if>
				<c-rt:if test="${opdetail.detailTp eq '1'}"><p><span class="txt-rd">预：</span>${opdetail.expectShipDate}</p></c-rt:if>
				<c-rt:if test="${(opdetail.boToWhDate+opdetail.deliveryDay) > 0}"><p><span class="txt-rd">备货：</span>${(opdetail.boToWhDate+opdetail.deliveryDay)}天</p></c-rt:if>
			</c-rt:if>
		</c:forEach>
		<p><a href="/help/8_policy.html" target="_blank" class="icon-change">
		<c-rt:choose>
  		<c-rt:when test="${empty oproduct.returnRule}">
  			<img src="/images/returnRule/07_15.gif"/>
  		</c-rt:when>
  		<c-rt:otherwise>
  			<img src="/images/returnRule/${oproduct.returnRule}.gif"/>
  		</c-rt:otherwise>
  	</c-rt:choose>
  	</a></p>
  	<c-rt:if test="${oproduct.prodTp ne '6'}">
  		<table class="tb-1">
			<tr>
  			<td>折扣：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${oproduct.discount}"/></td>
  			<td>积分：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${oproduct.bonus}"/></td>
  			<td>账户余额：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${oproduct.myWallet}"/></td>
  			<td>礼品卡：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${oproduct.giftcardBalance}"/></td>
  		</tr>
  		<tr>
  			<td>运费：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${oproduct.shipfare}"/></td>
  			<td>COD手续费：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${oproduct.codFee}"/></td>
  			<td>分期手续费：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${oproduct.installmentFee}"/></td>
  			<td>应付金额：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${oproduct.mustPay}"/></td>
  		</tr>  		  		  		
  		</table>
  		</c-rt:if>
    </td>
    <td>
	    <c:forEach items="${oproduct.orderProductDetail}" var="opdetail" varStatus="rowdetail_index">
			<c:if test="${oproduct.prodSeq == opdetail.prodSeq }">
				<c:if test="${opdetail.detailTp == '0' || opdetail.detailTp == '1' || opdetail.detailTp == '5' || (opdetail.detailTp == '6' && opdetail.prodId == oproduct.prodId)}">
		    		<fmt-rt:formatNumber value="${(opdetail.unitWeight+0.001)/1000}"  pattern="#,#0.00#"/>
		    	 </c:if>
		    </c:if>
			</c:forEach>
    </td>
    <td>
	    <c:forEach items="${oproduct.orderProductDetail}" var="opdetail" varStatus="rowdetail_index">
			<c:if test="${oproduct.prodSeq == opdetail.prodSeq }">
		    		<fmt-rt:formatNumber value="${opdetail.unitVolumeWeight}"  pattern="#,###,##0.00"/>
		    </c:if>
			</c:forEach>    
    </td>
    <td>${oproduct.qty}</td>
    <td><fmt:formatNumber value="${oproduct.unitPrice}" pattern="#,###,##0.00"/></td>
    <td><fmt:formatNumber value="${oproduct.coupon}" pattern="#,###,##0.00"/><br>
    <c:if test="${oproduct.couponItemId != ''&&oproduct.couponItemId!=null }">
	    ${pu:listAdd('couponItemId', oproduct.couponItemId) }
		${pu:reqSet('coupons', pu:queryByHql('from CouponItem where uuid=?', pu:arrayGet('couponItemId'), null)) }
		<c-rt:forEach items="${coupons }" var="coupon">
			<a href="javascript:doAR('<c-rt:url value="/json/couponLogs.do?couponCode=${coupon.code}"/>', 'dialog');openDialog('coupon消费纪录',content,700,300)">(${coupon.code})</a><br>
		</c-rt:forEach>
		${pu:reqSet('couponItemId',null)}
    </c:if>
    </td>
    <td><fmt:formatNumber value="${oproduct.unitPrice*oproduct.qty}" pattern="#,###,##0.00"/></td>
    <td><fmt:formatNumber value="${oproduct.totalPrice}" pattern="#,###,##0.00"/></td>
    <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${oproduct.logisticSendDt}" /></td>
    <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${oproduct.logisticFinalDt}" /></td>
    <!-- <td>${oproduct.returnQty}</td> -->
    <td>${logisticStMenu.options[oproduct.logisticSt].name}</td>
    <td>
    <c-rt:choose>
		<c-rt:when test="${(!empty oproduct.logisticCompany2) && (oproduct.logisticCompany2 != ' ')}">
			<c-rt:choose>
				<c-rt:when test="${empty logisticCompMenu.options[oproduct.logisticCompany2].name}">
					${oproduct.logisticCompany2}<br/>${oproduct.logisticNo}
				</c-rt:when>
				<c-rt:otherwise>
					${logisticCompMenu.options[oproduct.logisticCompany2].name}<br/>${oproduct.logisticNo}<br/>
					<a href="${logisticCompMenu.options[oproduct.logisticCompany2].memo1}${logisticCompMenu.options[oproduct.logisticCompany2].memo2}" target= "_blank">开启</a>
				</c-rt:otherwise>
			</c-rt:choose>
		</c-rt:when>
		<c-rt:otherwise>
			<c:if test="${(!empty oproduct.logisticCompany) && (oproduct.logisticCompany != ' ')}">
				<c-rt:choose>
					<c-rt:when test="${empty logisticCompMenu.options[oproduct.logisticCompany].name}">
						${oproduct.logisticCompany}<br/>${oproduct.logisticRefNum}
					</c-rt:when>
					<c-rt:otherwise>
						${logisticCompMenu.options[oproduct.logisticCompany].name}<br/>${oproduct.logisticRefNum}<br/>
						<a href="${logisticCompMenu.options[oproduct.logisticCompany].memo1}${logisticCompMenu.options[oproduct.logisticCompany].memo2}" target= "_blank">开启</a>
					</c-rt:otherwise>
				</c-rt:choose>
			</c:if>
		</c-rt:otherwise>
	</c-rt:choose>
    </td>
    <jsp:useBean id="now" class="java.util.Date"/>
    <td>
    	<c:if test="${oproduct.prodStatus=='1' || oproduct.prodStatus=='2'}">
    		<a href="javascript:doAR('<c-rt:url value="/serviceOrder/listServiceOrderByOrderProductAjax.do?orderProdId=${oproduct.orderProdId}&time=${now}"/>', 'dialog');openDialog('退货记录',content,650,500)">
    			退換货纪录
    		</a>
    		/
    	</c:if>
		<a href="javascript:doAR('<c-rt:url value="/order/fixInfo.do?orderProdId=${oproduct.orderProdId }"/>', 'dialog');openDialog('维修查询',content,650,500)">维修查询</a>
   	</td>  
	  <td>
	  	<c-rt:if test="${order.domainSrc=='yaodian100.tmall.com'}">
        orderProdId: ${oproduct.orderProdId}<br/>
        prodSpecId: ${oproduct.prodSpecId} 
      </c-rt:if>
	  </td> 
  </tr>
  </c:if>
  <c:forEach items="${oproduct.orderProductDetail}" var="opdetail" varStatus="rowdetail_index">
<c:if test="${oproduct.prodSeq == opdetail.prodSeq }">
<c:if test="${opdetail.detailTp != '0' && opdetail.detailTp != '1' && opdetail.detailTp != '5' && !(opdetail.detailTp == '6' && opdetail.prodId == oproduct.prodId)}">
  <tr class="${row_index.count % 2 == 0 ? 'bg-yl' : ''}"><!-- 明细 -->
  <td><a href="<%=ServerValue.getFrontHostname()%><%=ServerValue.getFrontContextPath()%>/product/product.do?productId=${opdetail.prodId}" target="blank"> ${opdetail.prodId}</a>
  <br><c-rt:if test="${fn:contains(snapShots,opdetail.prodId)}">
  	<a href="<c-rt:url value="/resource/${order.orderId}_${opdetail.prodId}_${opdetail.detailTp}.jpg?memberId=${order.memberId}"/>" target="blank">商品快照</a>
  	</c-rt:if>
  </td>
    <td height="30" style="text-align:left;">
<span class="type-${opdetail.detailTp}">${detailTpMenu.options[opdetail.detailTp].name}</span> ${opdetail.prodName}－<b>[${opdetail.prodSpecName}]</b>
<c-rt:if test="${order.orderSt=='35' && oproduct.prodStatus!='1' && oproduct.prodStatus!='2'&& oproduct.prodTp=='2'}">
[ <a href="/ecadmin/serviceOrder/toReturnProduct.do?orderProdId=${oproduct.orderProdId }">退货</a> ｜ <a href="/ecadmin/serviceOrder/toChangeProduct.do?orderProdId=${oproduct.orderProdId }">换货</a> ]
</c-rt:if>
		<c-rt:if test="${opdetail.canUseCod eq 'N'}">
		  <p>付款限定：<span class="txt-rd">不支持货到付款</span></p>
		</c-rt:if>
		<c-rt:if test="${not empty prodVolumeMap and not empty prodVolumeMap[opdetail.prodId]}">
			<p>配送限定：<span class="txt-rd">大材积</span></p>
		</c-rt:if>
		<c-rt:if test="${opdetail.detailTp eq '1'}"><p><span class="txt-rd">预：</span>${opdetail.expectShipDate}</p></c-rt:if>
		<c-rt:if test="${(opdetail.boToWhDate+opdetail.deliveryDay) > 0}"><p><span class="txt-rd">备货：</span>${(opdetail.boToWhDate+opdetail.deliveryDay)}天</p></c-rt:if>
	  <p><a href="/help/8_policy.html" target="_blank" class="icon-change">
		<c-rt:choose>
  		<c-rt:when test="${empty opdetail.returnRule}">
  			<img src="/images/returnRule/07_15.gif"/>
  		</c-rt:when>
  		<c-rt:otherwise>
  			<img src="/images/returnRule/${opdetail.returnRule}.gif"/>
  		</c-rt:otherwise>
  	</c-rt:choose>
  	</a></p>  
  		<table class="tb-1">
  		<tr>
  			<td>折扣：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${opdetail.discount}"/></td>
  			<td>积分：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${opdetail.bonus}"/></td>
  			<td>账户余额：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${opdetail.myWallet}"/></td>
  			<td>礼品卡：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${opdetail.giftcardBalance}"/></td>
  		</tr>
  		<tr>
  			<td>运费：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${opdetail.shipfare}"/></td>
  			<td>COD手续费：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${opdetail.codFee}"/></td>
  			<td>分期手续费：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${opdetail.installmentFee}"/></td>
  			<td>应付金额：<fmt-rt:formatNumber pattern="###,###,##0.0#" value="${opdetail.mustPay}"/></td>
  		</tr>  		  		
  		</table>
    </td>
    <td><fmt-rt:formatNumber value="${(opdetail.unitWeight+0.001)/1000}"  pattern="#,#0.00#"/></td>
    <td><fmt-rt:formatNumber value="${opdetail.unitVolumeWeight}"  pattern="#,###,##0.00"/></td>
    <td>${opdetail.qty}</td>    
    <td><fmt:formatNumber value="${opdetail.unitPrice}" pattern="#,###,##0.00"/></td>
    <td>--</td>
    <td><fmt:formatNumber value="${opdetail.amount}" pattern="#,###,##0.00"/></td>
    <td>--</td>
    <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${oproduct.logisticSendDt}" /></td>
    <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${oproduct.logisticFinalDt}" /></td>
    <!-- <td>${oproduct.returnQty}</td> -->
    <td>${logisticStMenu.options[oproduct.logisticSt].name}</td>
    <td>
    <c-rt:choose>
		<c-rt:when test="${(!empty oproduct.logisticCompany2) && (oproduct.logisticCompany2 != ' ')}">
			${pu:reqSet('lc', pu:get('com.yaodian100.crm.workorder.entity.LogisticProvider', oproduct.logisticCompany2)) }
			<c-rt:choose>
				<c-rt:when test="${empty lc}">
					${oproduct.logisticCompany2}<br/>${oproduct.logisticNo}
				</c-rt:when>
				<c-rt:otherwise>
					${lc.name}<br/>${oproduct.logisticNo}<br/>
					<a href="${lc.searchUrl}" target= "_blank">开启</a>
				</c-rt:otherwise>
			</c-rt:choose>
		</c-rt:when>
		<c-rt:otherwise>
			<c:if test="${(!empty oproduct.logisticCompany) && (oproduct.logisticCompany != ' ')}">
				${pu:reqSet('lc', pu:get('com.yaodian100.crm.workorder.entity.LogisticProvider', oproduct.logisticCompany)) }
				<c-rt:choose>
					<c-rt:when test="${empty lc}">
						${oproduct.logisticCompany}<br/>${oproduct.logisticRefNum}
					</c-rt:when>
					<c-rt:otherwise>
						${lc.name}<br/>${oproduct.logisticRefNum}<br/>
						<a href="${lc.searchUrl}" target= "_blank">开启</a>
					</c-rt:otherwise>
				</c-rt:choose>
			</c:if>
		</c-rt:otherwise>
	</c-rt:choose>
    </td>
    <td>
    	<c:if test="${oproduct.prodStatus=='1'}">
    		<a href="javascript:doAR('<c-rt:url value="/serviceOrder/page.do?iamlazy=detail&orderProdId=${oproduct.orderProdId }"/>', 'dialog');openDialog('退货记录',content,650,500)">
    			退货纪录
    		</a>
    		/
    	</c:if>
    	<c:if test="${oproduct.prodStatus=='2'}">
    		<a href="javascript:doAR('<c-rt:url value="/serviceOrder/page.do?iamlazy=detail&orderProdId=${oproduct.orderProdId }"/>', 'dialog');openDialog('换货记录',content,650,500)">
    			换货纪录
    		</a>
    		/
    	</c:if> 
    	<a href="javascript:doAR('<c-rt:url value="/order/fixInfo.do?orderProdId=${oproduct.orderProdId }"/>', 'dialog');openDialog('维修查询',content,650,500)">
    		维修查询
    	</a>
    </td>
<td></td>     
  </tr>
</c:if>
 
</c:if>
</c:forEach>
</c:forEach>

<tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >商品总额：<fmt:formatNumber value="${order.totalPrice}" pattern="#,###,##0.00"/></td>
  </tr>
 <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >－折抵优惠：<fmt:formatNumber value="${order.discount}" pattern="#,###,##0.00"/></td>
  </tr>
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >－－－－－－－－－－－－－－－－－－－－－－－－－</td>
  </tr>
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >＝合计金额：<fmt:formatNumber value="${order.amount}" pattern="#,###,##0.00"/></td>
  </tr>  
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >＋运费：<fmt:formatNumber value="${order.shipfare}" pattern="#,###,##0.00"/>
    <div id="editShipFare">
    <a name="editShipFareHere"> </a>
    <c-rt:if test="${canChgPaymentIfo=='Y'}">
    <form action="updateShipfare.do" method="post" id="updateShipfareForm" onSubmit="javascript:submitShipfare();return false;">
    ＋新运费：<input type="text"  class="txt-gy" name="newShipfare" id="newShipfare" value="<fmt:formatNumber value="${order.shipfare}" pattern="#,###,##0.00"/>" maxlength="5" size="5"/>
     <input type="submit" name="submit_button" id="submit_button" value="送出" />
     <input type="button" name="button2" id="newShipfareCancel" value="取消" />
    </form>
    </c-rt:if>
    </div>
    </td>
  </tr>
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >＋货到付款手续费：<fmt:formatNumber value="${order.codFee}" pattern="#,###,##0.00"/></td>
  </tr>
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >－折扣礼券：<fmt:formatNumber value="${order.coupon}" pattern="#,###,##0.00"/></td>
  </tr>
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >－折抵 <c-rt:if test = "${not empty order.orderBonusCampaign}">${order.bonus*order.orderBonusCampaign.offsetRate}</c-rt:if><c-rt:if test = "${empty order.orderBonusCampaign}">0</c-rt:if> 积分：<fmt:formatNumber value="${order.bonus}" pattern="#,###,##0.00"/></td>
  </tr>
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >－－－－－－－－－－－－－－－－－－－－－－－－－</td>
  </tr>
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >＝订单金额：<fmt:formatNumber value="${order.totalPrice - order.discount + order.shipfare + order.codFee - order.coupon  - order.bonus}" pattern="#,###,##0.00"/></td>
  </tr>
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >－礼品卡支付：<fmt:formatNumber value="${order.giftcardBalance}" pattern="#,###,##0.00"/></td>
  </tr>  
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >－账户余额支付：<fmt:formatNumber value="${order.myWallet}" pattern="#,###,##0.00"/></td>
  </tr>
  <c-rt:if test="${order.paymentTp=='80'}">
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >＋分期附加费：<fmt:formatNumber value="${order.installmentFee}" pattern="#,###,##0.00"/></td>
  </tr>
  </c-rt:if>  
    <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >－－－－－－－－－－－－－－－－－－－－－－－－－</td>
  </tr>
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >＝剩余应付金额：<b><font color="#ff3300"><fmt:formatNumber value="${order.mustPay}" pattern="#,###,##0.00"/></font></b></td>
  </tr>
<c-rt:if test="${order.orderId ne order.joinOrders}">
  <tr class="tb-R bg-yl">
    <td class="tmall" height="30" colspan="15" >＝合并结帐应付金额：<b><font color="#ff3300"><fmt:formatNumber value="${order.joinMustPay}" pattern="#,###,##0.00"/></font></b></td>
  </tr></c-rt:if>
  <c-rt:if test=  "${(not empty order.orderBonusCampaign) &&  order.orderBonusCampaign.giveBonus > 0}">
  <tr class="tb-R"><td  colspan="15">本次订单可获得 ${ order.orderBonusCampaign.giveBonus} 积分</td></tr>
  </c-rt:if>
</table>
<div class="f-link">
	<c-rt:if test="${not empty pop}"><a href="javascript:window.close()">关闭视窗</a> / </c-rt:if><c-rt:if test="${pu:substring(user.group.code, 0, 1)!='C'}"><a href="search.do">回订单查询页</a></c-rt:if><c-rt:if test="${pu:substring(user.group.code, 0, 1)=='C'}"><a href="../crmQuery/search.do">回CRM 查询</a></c-rt:if>
</div>
<!-- 1250.中台提供订单取消/还原功能  -->
<div id="cancelDialog" style="display:none" class="od-cancel-dailog"></div>
<!-- 1250.中台提供订单取消/还原功能  end -->